#include "../begonia.h"
#include "cgameover.h"
#include "cmenu.h"
#include "../base/scene.h"

void cgameover::display()
{
    glClear(GL_COLOR_BUFFER_BIT);
    f.show();
    drawPercentage();
    drawJiki();
    //====================================
    glColor4d(0.0,0.0,0.0,0.5);
    glPushMatrix();
        glBegin(GL_POLYGON);
            glVertex2d(-dLarge,-dLarge);
            glVertex2d(dLarge,-dLarge);
            glVertex2d(dLarge,dLarge);
            glVertex2d(-dLarge,dLarge);
        glEnd();
    glPopMatrix();
    if(missed)
    {
        glColor3d(1.0,1.0,1.0);
        drawstring(0.0,0.0,"MISSED!!");
    }
    if(picn==pictot)
    {
        glColor3d(1.0,1.0,1.0);
        drawstring(0.0,0.0,"SUCCESS!!");
    }
    //=====================================
    drawFPS();
    drawPictures();
    glutSwapBuffers();
}

void cgameover::key(unsigned char key, int x, int y)
{
    if(timeout)
    {
        screen=&menu;
        glutPostRedisplay();
    }
}

